<?php
/**
 * Created by PhpStorm.
 * User: andrei
 * Date: Jun 27, 2012
 * Time: 4:29:06 PM
 * To change this template use File | Settings | File Templates.
 */
 
class Db_Products_MemoryListProductPageTexts extends Common {
	protected static $tableName = TAB_MEMORY_LIST_PRODUCT_PAGE_TEXTS;
	protected static $dbFields = array(
        'id',
		'mppt_memory_product_page_id',
		'mppt_layout_item_id',
		'mppt_text',
		'mppt_font_family',
		'mppt_font_size',
		'mppt_text_align',
		'mppt_vertical_align',
		'mppt_color',
		'mppt_rotation',
		'mppt_width',
		'mppt_height',
		'mppt_x',
		'mppt_y',
		'mppt_poem_id',
        'deleted'
	);


	/**
	 * @var Db_Products_MemoryListProductPageTexts
	 */
	public $objectArray;

	public $id;
	public $mppt_memory_product_page_id;
	public $mppt_layout_item_id;
	public $mppt_text;
	public $mppt_font_family;
	public $mppt_font_size;
	public $mppt_text_align;
	public $mppt_vertical_align;
	public $mppt_color;
	public $mppt_rotation;
	public $mppt_width;
	public $mppt_height;
	public $mppt_x;
	public $mppt_y;
	public $mppt_poem_id;
    public $deleted;

    function __construct($value=NULL, $fieldName=NULL) {
        parent::__construct($value, $fieldName);
    }

	public static function deleteByLiIds($liIds = array()) {
		$liIdsList = implode(',', $liIds);
		self::$DB->q("DELETE FROM ?f WHERE `mppt_layout_item_id` IN( ? )", self::$tableName, $liIdsList);
        return (self::$DB->affectedRows() ? true : false);
	}

}